As personal computing devices become more powerful, containing increased storage space and processing capabilities, the average user consumes an increasingly smaller percentage of those resources in performing everyday tasks. Thus, many of today's personal computing devices are often not used to their full potential because their computing abilities greatly exceed the demands most users place upon them. An increasingly popular method of deriving use and value from the unused resources of powerful modern personal computing devices is a distributed computing system, in which the computing devices act in coordination with one another to perform tasks and maintain data.
A distributed computing system can utilize a number of interconnected computing devices to achieve the performance and storage capabilities of a larger, more-expensive computing device. Thus, while each personal computing device may only have a few gigabytes of usable storage space, a distributed computing system comprising a number of such devices, can aggregate the available storage space on each individual device and present to a user a terabyte or more of useable storage space. Similarly, a distributed computing system can present to a user a large amount of useable processing power by dividing the user's tasks into smaller segments and transmitting the segments to the individual devices for processing in parallel.
To effectively derive value from the unused capabilities of modern personal computing devices, a distributed computing system should not interfere with the individual use of each personal computing device. By allowing individual users to retain control of the devices, however, the reliability of each device is greatly decreased. To compensate for the increased risk that the individual computing device may become disconnected from the network, turned off, suffer a system malfunction, or otherwise become unusable to the distributing computing system, redundancy can be used to allow the distributed computing system to remain operational. Thus, the information stored on any one personal computing device can be redundantly stored on at least one additional similar personal computing device, allowing the information to remain accessible, even if one of the personal computing devices fails.
Alternatively, a distributed computing system can practice complete redundancy, in which every device within the system performs identical tasks and stores identical information. Such a system can allow users to continue to perform useful operations even if all but one of the devices should fail. Alternatively, such a system can be used to allow multiple copies of the same information to be distributed throughout a geographic region. For example, a multi-national corporation can establish a world-wide distributed computing system. Such a corporation might use a number of high performance server computing devices, rather than less powerful personal computing devices, because each individual computing device would be required to service many users within that geographic region. The individual high performance devices can each perform identical tasks and store identical data, allowing users who merely seek to access the data to obtain such access from a high performance device located in a convenient location for that user.
However, distributed computing systems can be difficult to maintain due to the complexity of properly synchronizing the individual devices that comprise the system. Because time-keeping across individual processes can be difficult at best, a state machine approach is often used to coordinate activity among the individual devices. A state machine can be described by a set of states, a set of commands, a set of responses, and functions that link each response/state pair to each command/state pair. A state machine can execute a command by changing its state and producing a response. Thus, a state machine can be completely described by its current state and the action it is about to perform, removing the need to use precise time-keeping.
The current state of a state machine is, therefore, dependent upon its previous state, the commands performed since then, and the order in which those commands were performed. To maintain synchronization between two or more state machines, a common initial state can be established, and each state machine can, beginning with the initial state, execute the identical commands in the identical order. Therefore, to synchronize one state machine to another, a determination of the commands performed by the other state machine needs to be made. The problem of synchronization, therefore, becomes a problem of determining the order of the commands performed, or, more specifically, determining the particular command performed for a given step.
One mechanism for determining which command is to be performed for a given step is known as the Paxos algorithm. In the Paxos algorithm, any of the individual devices can act as a leader and seek to propose that a given function be executed by every device in the system as the command to be performed for a given step. Every such proposal can be sent with a proposal number to more easily track the proposals. Such proposal numbers need not bear any relation to the particular step for which the devices are attempting to agree upon a command to perform. Initially, the leader can suggest a proposal number for a proposal the leader intends to submit. Each of the remaining devices can then respond to the leader's suggestion of a proposal number with an indication of the last proposal they voted for, or an indication that they have not voted for any proposals. If, through the various responses, the leader does not learn of any other proposals that were voted for by the devices, the leader can propose that a given function be executed by the devices, using the proposal number suggested in the earlier message. Each device can, at that stage, determine whether to vote for the action or reject it. A device should only reject an action if it has responded to another leader's suggestion of a different proposal number. If a sufficient number of devices, known as a quorum, vote for the proposal, the proposed action is said to have been agreed upon, and each device performs the action and transmits the results. In such a manner, an agreed upon command can be determined to be performed for a given step, maintaining the same state among all of the devices.
Generally, the Paxos algorithm can be though of in two phases, with an initial phase that allows a leader to learn of prior proposals that were voted on by the devices, as described above, and a second phase in which the leader can propose functions for execution. Once the leader has learned of prior proposals, it need not continually repeat the first phase. Instead, the leader can continually repeat the second phase, proposing a series of functions, that can be executed by the distributed computing system in multiple steps. In such a manner, while each function performed by the distributed computing system for each step can be though of as one instance of the Paxos algorithm, the leader need not wait for the devices to vote on a proposed function for a given step before proposing another function for the next step.
The distributed computing system, as a whole, can be modeled as a state machine. Thus, a distributed computing system implementing complete redundancy can be one in which each of the devices replicate the state of the overall system. Such a system requires that each device maintain the same state. If some devices believe that one function was executed, while a second group of devices believes that a second function was executed, the overall system no longer operates as a single state machine. To avoid such a situation, a majority of the devices can be generally required to select a proposed function for execution by the system. Because any two groups of devices, each having a majority, must share at least one device, mechanisms, such as the Paxos algorithm, can be implemented that rely on the at least one common device to prevent two groups, each containing a majority of devices, to select differing proposed functions.
The Paxos algorithm, however, requires at least two message delays between the time when a device that is part of the distributed computing system receives a request from a client and the time when the distributed computing system has agreed upon the execution of the proposed function requested by the client, executes that function, and transmits the results back to the client. Furthermore, the Paxos algorithm can require the presence of a leader device that receives client requests and determines the appropriate functions to submit for a vote to the devices of the distributed computing system. Should such a leader device fail, a new leader may not take its place immediately, leaving the distributed computing system idle and the client waiting for a response to its requests.